package GAMEMODE;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import java.awt.AWTException;
import java.awt.CardLayout;
import java.awt.BorderLayout;
import java.awt.Robot;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JPanel;
import java.awt.GridLayout;
import javax.swing.JButton;
import java.awt.Font;
import java.awt.Color;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.awt.Toolkit;
@SuppressWarnings("serial")
public class MAIN_START extends JFrame implements ActionListener{
	JPanel panel = new JPanel();
	int gaofix=0;
	JLabel label_8 = new JLabel("永烧不息！");
    int die = StdRandom.uniform(5, 1500);
	static Robot robot;
	int zt=2;
	JLabel label_9 = new JLabel("");
	JLabel label_10 = new JLabel("");
	int gold_s=0;
	int hp=100;
	int old_men;
	int chuk=0;
	int misson_s_1=0;
	int misson_s_2=0;
	int misson_s_3=0;
	int misson_s_4=0;
	int misson_s_5=0;
	int misson_s_6=0;
	int misson_s_7=0;
	int misson_s_8=0;
	int misson_s_9=0;
	int misson_s_10=0;
	JLabel lblNewLabel = new JLabel("\u77FF\u5DE5");
	int c=0;
	static int mei_s=0;
	int []gao=new int[3];
	int shuijing_s=0;
	public static JLabel back[] = new JLabel[1900];
	public static JLabel chuck[] = new JLabel[1500];
	JLabel label_5 = new JLabel("");
	int play=1;
	final JLabel label_1 = new JLabel(""+hp);
	JPanel panel_1 = new JPanel();
	int iron_s=0;
	int []iron=new int[500];
	int []mu=new int[50];
	int []mei=new int[400];
	int []shuijin=new int[50];
	int []gold=new int[450];
	public int mu_s=0;
	int men=3;
	boolean b=true;
	int daoban=0;
	JLabel label_2 = new JLabel("");
	public MAIN_START() {
  		try{
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	}catch(Exception e){
		
	}
		setIconImage(Toolkit.getDefaultToolkit().getImage(MAIN_START.class.getResource("/RES/breok.png")));
		gao[0]=785;
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//saves//daoban");
			DataInputStream DIS=new DataInputStream(FIS);
			daoban=DIS.readInt();
		}catch(IOException e){
			System.out.println(e);
		}
//if(daoban==1){
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m1");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_1=DIS.readInt();
		}catch(IOException e){
			misson_s_1=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m2");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_2=DIS.readInt();
		}catch(IOException e){
			misson_s_2=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m3");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_3=DIS.readInt();
		}catch(IOException e){
			misson_s_3=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m4");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_4=DIS.readInt();
		}catch(IOException e){
			misson_s_4=0;
			System.out.println(e);
		}		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m5");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_5=DIS.readInt();
		}catch(IOException e){
			misson_s_5=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m6");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_6=DIS.readInt();
		}catch(IOException e){
			misson_s_6=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m7");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_7=DIS.readInt();
		}catch(IOException e){
			misson_s_7=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m8");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_8=DIS.readInt();
		}catch(IOException e){
			misson_s_8=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m9");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_9=DIS.readInt();
		}catch(IOException e){
			misson_s_9=0;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//m10");
			DataInputStream DIS=new DataInputStream(FIS);
			misson_s_10=DIS.readInt();
		}catch(IOException e){
			misson_s_10=0;
			System.out.println("Has Error :"+e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//gao");
			DataInputStream DIS=new DataInputStream(FIS);
			gao[0]=DIS.readInt();
		}catch(IOException e){
			gao[0]=(int) 392.5;
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//mei.dat");
			DataInputStream DIS=new DataInputStream(FIS);
			mei_s=DIS.readInt();
		}catch(IOException e){
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//mu");
			DataInputStream DIS=new DataInputStream(FIS);
			mu_s=DIS.readInt();
		}catch(IOException e){
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//iron");
			DataInputStream DIS=new DataInputStream(FIS);
			iron_s=DIS.readInt();
		}catch(IOException e){
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//chuk");
			DataInputStream DIS=new DataInputStream(FIS);
			chuk=DIS.readInt();
		}catch(IOException e){
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//shuijin.dat");
			DataInputStream DIS=new DataInputStream(FIS);
			shuijing_s=DIS.readInt();
		}catch(IOException e){
			System.out.println(e);
		}
		try{
			FileInputStream FIS=new FileInputStream("C://mcm//saves//gold");
			DataInputStream DIS=new DataInputStream(FIS);
			gold_s=DIS.readInt();
		}catch(IOException e){
			System.out.println(e);
		}
		try {
			robot=new Robot();
		} catch (AWTException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setResizable(false);
		setTitle("MINECRAFT\u77FF\u5DE5");
		getContentPane().setLayout(new BorderLayout(0, 0));
		
		getContentPane().add(panel, BorderLayout.CENTER);
		panel.setLayout(new CardLayout(0, 0));
		
		panel_1.setBackground(Color.WHITE);
		panel.add(panel_1, "name_1020300615477");
		panel_1.setLayout(null);
		
		lblNewLabel.setFont(new Font("黑体", Font.BOLD | Font.ITALIC, 40));
		
		JLabel lblPlay = new JLabel("PLAY");
		lblPlay.setFont(new Font("Minecraft", Font.PLAIN, 13));
		lblPlay.setForeground(Color.WHITE);
		lblPlay.setBounds(355, 237, 45, 25);
		panel_1.add(lblPlay);
		
		label_10.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/CRAFT.png")));
		label_10.setBounds(680, 50, 120, 67);
		panel_1.add(label_10);
		
		label_9.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/MINE.png")));
		label_9.setBounds(0, 50, 160, 67);
		panel_1.add(label_9);
		final JLabel label = new JLabel("");
		label.setFont(new Font("黑体", Font.PLAIN, 23));
		label.setBounds(271, 237, 205, 25);
		panel_1.add(label);
		
				label.addMouseListener(new MouseAdapter() {
					@Override
					public void mouseEntered(MouseEvent arg0) {
						if(play==1){
						label.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/button2.png")));
						}
					}
					@Override
					public void mouseExited(MouseEvent arg0) {
						if(play==1){
						label.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/button.png")));
						}
					}
					@Override
					public void mouseClicked(MouseEvent arg0) {
						if(play==1){
							if(b==true){
						CardLayout cl=(CardLayout) panel.getLayout();
						cl.next(panel);
						label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
						play=2;
							}if(b==false){
								CardLayout cl=(CardLayout) panel.getLayout();
								cl.next(panel);
								label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
								chuck[men].setIcon(new ImageIcon(MAIN_START.class.getResource("")));
								play=2;
								hp=100;
								men=3;
								chuck[3].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/char.PNG")));
								label_1.setText(""+hp);
								old_men=3;
							}
						}
						}
				});
				label.setHorizontalAlignment(SwingConstants.CENTER);
				label.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/button.PNG")));
				
				final JLabel label_4 = new JLabel("");
				label_4.setForeground(Color.RED);
				label_4.setFont(new Font("Minecraft", Font.PLAIN, 32));
				label_4.setBounds(271, 160, 241, 67);
				panel_1.add(label_4);
				
				JButton button_3 = new JButton("\u5173\u4E8E");
				button_3.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						final JFrame about=new JFrame("about");
						about.setSize(400, 300);
						about.setBackground(Color.RED);
						setBackground(Color.RED);
						about.setVisible(true);
						about.setForeground(Color.RED);
						about.getContentPane().setLayout(null);
						final JLabel label= new JLabel("MINECRAFT矿 工 ");
						label.setForeground(Color.BLUE);
						label.setFont(new Font("黑体", Font.BOLD,24));
						label.setBounds(50, 0, 241, 30);
						about.getContentPane().add(label);
						final JLabel label1= new JLabel("lka制作");
						label1.setForeground(Color.RED);
						label1.setFont(new Font("黑体", Font.BOLD,20));
						label1.setBounds(50, 50, 241, 30);
						about.getContentPane().add(label1);
						final JLabel label2= new JLabel("Ver.1.0.0 Bata");
						label2.setForeground(Color.GREEN);
						label2.setFont(new Font("黑体", Font.PLAIN,20));
						label2.setBounds(50, 90, 241, 30);
						about.getContentPane().add(label2);
						about.addMouseListener(new MouseAdapter() {
							@SuppressWarnings("deprecation")
							@Override
							public void mouseClicked(MouseEvent arg0) {
								about.hide();
							}
						});
					}
				});
				
				JButton button_6 = new JButton("\u4FEE\u590D");
				button_6.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						final JFrame fix=new JFrame();
						fix.setSize(300,200);
						fix.setVisible(true);
						fix.getContentPane().setLayout(null);
						JButton button_6 = new JButton("\u4FEE\u590D");
						JLabel label= new JLabel("MINECRAFT矿工 ");
						if(gao[0]!=785){
							gaofix=2;
							label.setText("修复铁镐只消3块铁锭！");
						}if(gao[0]==785){
							gaofix=1;
							button_6.setText("YES");
							label.setText("铁镐完好！");
						}
						label.setFont(new Font("微软雅黑", Font.BOLD,12));
						label.setBounds(0, 0,300, 30);
						fix.getContentPane().add(label);
						button_6.addActionListener(new ActionListener() {

							@SuppressWarnings("deprecation")
							@Override
							public void actionPerformed(ActionEvent arg0) {
								if(gaofix==2){
									iron_s=iron_s-3;
									fix.hide();
									gao[0]=785;
								}
								if(gaofix==1){
									fix.hide();
								}
							}});
						button_6.setBounds(95,100, 100,20);
						fix.getContentPane().add(button_6);
					}
				});
				
				JButton button_7 = new JButton("\u6E05\u9664\u4EFB\u52A1\u8BB0\u5F55");
				button_7.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						int i=1;
						while(i<=10){
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m"+i);
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(0);
			                  } catch (Exception eee)
			                  {
			                  }
						 i++;
						}
						 JFrame saved=new JFrame("已\u6E05\u9664！");
						 saved.setSize(600, 100);
						 saved.setVisible(true);
							JLabel label_5 = new JLabel("已\u6E05\u9664！Java I/O system delete you misson!请重启游戏!Plaese rest you game!");
							label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/javax/swing/plaf/metal/icons/ocean/floppy.gif")));
							saved.getContentPane().add(label_5);
					}
				});
				
				JButton button_8 = new JButton("\u6E05\u9664\u6E38\u620F\u8BB0\u5F55");
				button_8.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						try
		              	{//获得输出流
		              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//mu");
		              		DataOutputStream DOS=new DataOutputStream(fos);
		              		DOS.writeInt(0);
		                  } catch (Exception eee)
		                  {
		                  }
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//iron");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(0);
			                  } catch (Exception eee)
			                  {
			                  }
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//mei.dat");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(0);
			                  } catch (Exception eee)
			                  {			System.out.println(eee);
			                  }
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//chuk");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(0);
			                  } catch (Exception eee)
			                  {
			                  }
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//shuijin.dat");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(0);
			                  } catch (Exception eee)
			                  {
			                  }
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//gao");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(785);
			                  } catch (Exception eee)
			                  {
			                  }
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//gold");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(0);
			                  } catch (Exception eee)
			                  {
			                  }
							byte i=1;
							while(i<=10){
								 try
					              	{//获得输出流
					              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m"+i);
					              		DataOutputStream DOS=new DataOutputStream(fos);
					              		DOS.writeInt(0);
					                  } catch (Exception eee)
					                  {
					                  }
								 i++;
								}
						 JFrame saved=new JFrame("rested save file!");
						 saved.setSize(600, 100);
						 saved.setVisible(true);
							JLabel label_5 = new JLabel("The JAVA I/O system rest you misson!请重启游戏!Plaese rest you game!");
							label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/javax/swing/plaf/metal/icons/ocean/floppy.gif")));
							saved.getContentPane().add(label_5);
					}
				});
				button_8.setFont(new Font("宋体", Font.PLAIN, 12));
				button_8.setBounds(10, 124, 110, 23);
				panel_1.add(button_8);
				button_7.setFont(new Font("宋体", Font.PLAIN, 12));
				button_7.setBounds(10, 101, 110, 23);
				panel_1.add(button_7);
				button_6.setBounds(10, 56, 93, 23);
				panel_1.add(button_6);
				
				JButton btnSavebag = new JButton("SAVE");
				btnSavebag.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//mu");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(mu_s);
			                  } catch (Exception eee)
			                  {
			                  }
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//iron");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(iron_s);
				                  } catch (Exception eee)
				                  {
				                  }
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//mei.dat");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(mei_s);
				                  } catch (Exception eee)
				                  {			System.out.println(eee);
				                  }
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//chuk");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(chuk);
				                  } catch (Exception eee)
				                  {
				                  }
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//shuijin.dat");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(shuijing_s);
				                  } catch (Exception eee)
				                  {
				                  }
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//gao");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(gao[0]);
				                  } catch (Exception eee)
				                  {
				                  }
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//gold");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(gold_s);
				                  } catch (Exception eee)
				                  {
				                  }
							 JFrame saved=new JFrame("已保存！");
							 saved.setSize(400, 100);
							 saved.setVisible(true);
								JLabel label_5 = new JLabel("已保存！Java I/O system saved you game!");
								label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/javax/swing/plaf/metal/icons/ocean/floppy.gif")));
								saved.getContentPane().add(label_5);
						
					}
				});
				btnSavebag.setBounds(10, 79, 93, 23);
				panel_1.add(btnSavebag);
				button_3.setBounds(10, 10, 93, 23);
				panel_1.add(button_3);
				
				JButton button_4 = new JButton("\u9000\u51FA");
				button_4.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						System.exit(0);
					}
				});
				button_4.setFont(new Font("黑体", Font.PLAIN, 12));
				button_4.setBounds(10, 33, 93, 23);
				panel_1.add(button_4);
				
				JPanel panel_9 = new JPanel();
				panel_9.setBounds(0, 0, 800, 600);
				panel_1.add(panel_9);
				panel_9.setLayout(new GridLayout(36, 0, 0, 0));
		
		JPanel panel_2 = new JPanel();
		panel_2.setBackground(Color.BLACK);
		panel.add(panel_2, "name_1024453770771");
		panel_2.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_3 = new JPanel();
		panel_3.setBackground(Color.BLACK);
		panel_2.add(panel_3, BorderLayout.NORTH);
		
		JButton btnBag = new JButton("\u80CC\u5305");
		btnBag.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				JFrame bag=new JFrame();
				bag.setSize(400,300);
				bag.setVisible(true);
				JPanel panel_7 = new JPanel();
				bag.getContentPane().add(panel_7);
				panel_7.setLayout(new GridLayout(15, 0, 0,0));
				JLabel label_1 = new JLabel("共计："+chuk);
				label_1.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/breok.png")));
				panel_7.add(label_1);
				JLabel label_2 = new JLabel("共计："+iron_s);
				label_2.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/iron2.png")));
				panel_7.add(label_2);
				JLabel label_3 = new JLabel("共计："+mu_s);
				label_3.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/mu.png")));
				panel_7.add(label_3);
				JLabel label_4 = new JLabel("共计："+mei_s);
				label_4.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/mei2.png")));
				panel_7.add(label_4);
				JLabel label_5 = new JLabel("共计："+shuijing_s);
				label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/shuijin2.png")));
				panel_7.add(label_5);
				JLabel label_7 = new JLabel("剩余："+gold_s);
				label_7.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/gold2.png")));
				panel_7.add(label_7);
				JLabel label_6 = new JLabel("剩余："+gao[0]);
				label_6.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/ironbreok.png")));
				panel_7.add(label_6);
			}
		});
		label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/cash1.png")));
		
		panel_3.add(label_5);
		panel_3.add(btnBag);
		
		JButton btnSaveBag = new JButton("save bag");
		btnSaveBag.setFont(new Font("Minecraft", Font.PLAIN, 14));
		btnSaveBag.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				 try
              	{//获得输出流
              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//mu");
              		DataOutputStream DOS=new DataOutputStream(fos);
              		DOS.writeInt(mu_s);
                  } catch (Exception eee)
                  {
                  }
				 try
	              	{//获得输出流
	              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//iron");
	              		DataOutputStream DOS=new DataOutputStream(fos);
	              		DOS.writeInt(iron_s);
	                  } catch (Exception eee)
	                  {
	                  }
				 try
	              	{//获得输出流
	              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//mei.dat");
	              		DataOutputStream DOS=new DataOutputStream(fos);
	              		DOS.writeInt(mei_s);
	                  } catch (Exception eee)
	                  {			System.out.println(eee);
	                  }
				 try
	              	{//获得输出流
	              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//chuk");
	              		DataOutputStream DOS=new DataOutputStream(fos);
	              		DOS.writeInt(chuk);
	                  } catch (Exception eee)
	                  {
	                  }
				 try
	              	{//获得输出流
	              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//shuijin.dat");
	              		DataOutputStream DOS=new DataOutputStream(fos);
	              		DOS.writeInt(shuijing_s);
	                  } catch (Exception eee)
	                  {
	                  }
				 try
	              	{//获得输出流
	              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//gao");
	              		DataOutputStream DOS=new DataOutputStream(fos);
	              		DOS.writeInt(gao[0]);
	                  } catch (Exception eee)
	                  {
	                  }
				 try
	              	{//获得输出流
	              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//gold");
	              		DataOutputStream DOS=new DataOutputStream(fos);
	              		DOS.writeInt(gold_s);
	                  } catch (Exception eee)
	                  {
	                  }
				 JFrame saved=new JFrame("已保存！");
				 saved.setSize(400, 100);
				 saved.setVisible(true);
					JLabel label_5 = new JLabel("已保存！Java I/O system saved you game!");
					label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/javax/swing/plaf/metal/icons/ocean/floppy.gif")));
					saved.getContentPane().add(label_5);
			}
		});
		panel_3.add(btnSaveBag);
		
		JButton btnHomepage = new JButton("HomePage");
		btnHomepage.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				CardLayout cl=(CardLayout) panel.getLayout();
				cl.next(panel);
				label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
				play=1;
				Thread t = new mc();
				t.start();
			}
		});
		Thread t = new mc();
		t.start();
		JButton button_5 = new JButton("\u6210\u5C31\u4EEC");
		button_5.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				JFrame craft=new JFrame();
				craft.setSize(400,300);
				craft.setVisible(true);
				craft.setResizable(false);
				craft.getContentPane().setLayout(new GridLayout(10, 0, 0,0));
				if(chuk>=250){
					JLabel label_1 = new JLabel("石人");
					label_1.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/stoneR.png")));
					craft.getContentPane().add(label_1);
				}
				if(chuk>=500){
					JLabel label_2 = new JLabel("石头怪物！");
					label_2.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/stoneR.png")));
					craft.getContentPane().add(label_2);
				}
				if(chuk>=1000){
					JLabel label_3 = new JLabel("石头大王！");
					label_3.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/stoneR.png")));
					craft.getContentPane().add(label_3);
				}
				if(iron_s>=300){
					JLabel label_4 = new JLabel("钢铁侠！");
					label_4.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/iron2.png")));
					craft.getContentPane().add(label_4);
				}
				if(shuijing_s>=100){
					JLabel label_7 = new JLabel("钻石“人！！！”");
					label_7.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/shuijin2.png")));
					craft.getContentPane().add(label_7);
				}
				if(mei_s>=100){
					craft.getContentPane().add(label_8);
					Thread fire=new fire();
					fire.start();
				}
				if(chuk>=1500){
					JLabel label_5 = new JLabel("石头BOSS！");
					label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/stone.png")));
					craft.getContentPane().add(label_5);
				}
				JLabel label_6 = new JLabel("完成更多的成就！");
				label_6.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/puls.png")));
				craft.getContentPane().add(label_6);
			}
		});
		button_5.setFont(new Font("微软雅黑", Font.PLAIN, 13));
		panel_3.add(button_5);
		btnHomepage.setFont(new Font("Minecraft", Font.PLAIN, 15));
		panel_3.add(btnHomepage);
		
		JButton btnNewButton = new JButton("\u4EFB\u52A1");
		btnNewButton.setFont(new Font("宋体", Font.PLAIN, 12));
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				final JFrame craft=new JFrame("任务");
				craft.setSize(400,300);
				craft.setVisible(true);
				craft.setResizable(false);
				craft.getContentPane().setLayout(new GridLayout(10, 0, 0,0));
				if(misson_s_1==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 来硬的！获得“铁”");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(iron_s>=1){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_1=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m1");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}
				if(misson_s_2==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 获得“木头”");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(mu_s>=1){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_2=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m2");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}
				if(misson_s_3==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 获得“钻石”");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(shuijing_s>=1){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_3=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m3");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}
				if(misson_s_4==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 获得“煤”");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(mei_s>=1){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_4=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m4");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}
				if(misson_s_5==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 僵硬过度！"+iron_s+"/400块铁锭");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(iron_s>=400){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_5=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m5");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}
				if(misson_s_6==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 坚不可摧！"+shuijing_s+"/100块钻石");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(shuijing_s>=100){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_6=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m6");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}
				if(misson_s_7==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 倒“煤”!"+mei_s+"/450块煤");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(mei_s>=450){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_7=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m7");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}
				if(misson_s_8==0){
				final JPanel misson1= new JPanel();
				misson1.setLayout(new BorderLayout(0, 0));
				craft.getContentPane().add(misson1);
				JLabel label_6 = new JLabel(" 金块多多!"+gold_s+"/200块金锭");
				misson1.add(label_6,BorderLayout.CENTER);
				JButton button = new JButton("完成");
				if(gold_s>=200){
				misson1.add(button, BorderLayout.EAST);
				button.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {		
						misson_s_8=1;
						 try
			              	{//获得输出流
			              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m8");
			              		DataOutputStream DOS=new DataOutputStream(fos);
			              		DOS.writeInt(1);
			                  } catch (Exception eee)
			                  {
			                  }
					}
					});
				}
				}	
				if(misson_s_9==0){
					final JPanel misson1= new JPanel();
					misson1.setLayout(new BorderLayout(0, 0));
					craft.getContentPane().add(misson1);
					JLabel label_6 = new JLabel(" 获得金锭!");
					misson1.add(label_6,BorderLayout.CENTER);
					JButton button = new JButton("完成");
					if(gold_s>=1){
					misson1.add(button, BorderLayout.EAST);
					button.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent arg0) {		
							misson_s_9=1;
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m9");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(1);
				                  } catch (Exception eee)
				                  {
				                  }
						}
						});
					}
					}
				if(misson_s_10==0){
					final JPanel misson1= new JPanel();
					misson1.setLayout(new BorderLayout(0, 0));
					craft.getContentPane().add(misson1);
					JLabel label_6 = new JLabel(" 空空如也!破坏1499个方块，已破坏"+chuk+"块。");
					misson1.add(label_6,BorderLayout.CENTER);
					JButton button = new JButton("完成");
					if(chuk>=1499){
					misson1.add(button, BorderLayout.EAST);
					button.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent arg0) {		
							misson_s_10=1;
							 try
				              	{//获得输出流
				              		FileOutputStream fos = new FileOutputStream("C://mcm//saves//m10");
				              		DataOutputStream DOS=new DataOutputStream(fos);
				              		DOS.writeInt(1);
				                  } catch (Exception eee)
				                  {
				                  }
						}
						});
					}
					}
			}
		});
		panel_3.add(btnNewButton);
		

		panel_3.add(label_2);
		
		JPanel panel_4 = new JPanel();
		panel_4.setBackground(Color.BLACK);
		panel_2.add(panel_4, BorderLayout.CENTER);
		panel_4.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_5 = new JPanel();
		panel_5.setBackground(Color.BLACK);
		panel_4.add(panel_5, BorderLayout.SOUTH);
		
		JPanel panel_8 = new JPanel();
		panel_8.setBackground(Color.BLACK);
		panel_5.add(panel_8);
		panel_8.setLayout(new BorderLayout(0, 0));
		
		JButton btnUp = new JButton("\u4E0A");
		panel_8.add(btnUp, BorderLayout.NORTH);
		
		JButton button = new JButton("\u5DE6");
		panel_8.add(button, BorderLayout.WEST);
		JButton button_1 = new JButton("\u53F3");
		panel_8.add(button_1, BorderLayout.EAST);
		JButton button_2 = new JButton("\u4E0B");
		panel_8.add(button_2, BorderLayout.SOUTH);
		
		JLabel label_3 = new JLabel("     ");
		panel_8.add(label_3, BorderLayout.CENTER);
		label_1.setFont(new Font("Minecraft", Font.PLAIN, 16));
		label_1.setHorizontalAlignment(SwingConstants.CENTER);
		label_1.setBackground(Color.WHITE);
		label_1.setForeground(Color.WHITE);
		label_1.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/hp.png")));
		panel_5.add(label_1);
		
		JPanel panel_7 = new JPanel();
		panel_5.add(panel_7);
		panel_7.setLayout(new BorderLayout(0, 0));
		
		final JLabel label_17 = new JLabel("");
		panel_7.add(label_17);
		
		JPanel panel_6 = new JPanel();
		panel_6.setBackground(Color.BLACK);
		panel_4.add(panel_6, BorderLayout.CENTER);
		panel_6.setLayout(new GridLayout(30, 0, 0,0));
		int i=0;

		while(i<1500){
			
			if(i!=3){
				chuck[i]=new JLabel();
				chuck[i].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/stone.png")));
				panel_6.add(chuck[i]);
			}if(i==3){
				chuck[men]=new JLabel();
				chuck[men].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/char.png")));
				panel_6.add(chuck[men]);;
			}
			i++;
		}
		i=0;

		while(i<1800){
				back[i]=new JLabel();
				back[i].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/background.png")));
				panel_9.add(back[i]);
			i++;
		}
		int kuang=0;
		while(kuang<400){
            int x = StdRandom.uniform(4,1500);
            mei[kuang]=x;
            chuck[mei[kuang]].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/mei.png")));		
            kuang++;
		}
		kuang=0;
		while(kuang<350){
			int x= StdRandom.uniform(4, 1500);
            iron[kuang] = x;
            chuck[iron[kuang]].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/iron.png")));		
            kuang++;
		}
		kuang=0;
		while(kuang<100){
			int x= StdRandom.uniform(4, 1500);
           gold[kuang] = x;
            chuck[ gold[kuang]].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/gold.png")));		
            kuang++;
		}
		Thread yanjiang=new yanjiang_gif();
		yanjiang.start();
		Thread wifi=new wifi_gif();
		wifi.start();
		kuang=0;
		while(kuang<50){
            int x = StdRandom.uniform(4, 1500);
            mu[kuang]=x;
            chuck[mu[kuang]].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/mu.png")));		
            kuang++;
		}
		kuang=0;
		while(kuang<50){
            int x = StdRandom.uniform(4, 1500);
            shuijin[kuang]=x;
            chuck[shuijin[kuang]].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/shuijin.png")));		
            kuang++;
		}
		btnUp.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				if(hp==0){
					CardLayout cl=(CardLayout) panel.getLayout();
					cl.next(panel);
					label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					play=1;
					label_4.setText("You Are DIE!");
					b=false;
				}
				int kuang=0;
				while(kuang<50){
					if(men-50==mu[kuang]){
						mu_s++;
						break;
					}
		            kuang++;
				}
				kuang=0;
				while(kuang<50){
					if(men-50==shuijin[kuang]){
						shuijing_s++;
						break;
					}
		            kuang++;
				}
				do{
					kuang=0;
					while(kuang<350){
						if(men-50==iron[kuang]){
							iron_s++;
							break;
						}
			            kuang++;
					}
					kuang=0;
					while(kuang<400){
						if(men-50==mei[kuang]){
							mei_s++;
							break;
						}
			            kuang++;
					}
					while(kuang<100){
						if(men-50==gold_s){
							gold_s++;
							break;
						}
			            kuang++;
					}
				if( men-50==die){
					Thread hp_1=new hp();
					hp_1.start();
					hp=hp-10;
					label_1.setText(""+hp);
					break;
				}
				if(hp==0){
					CardLayout cl=(CardLayout) panel.getLayout();
					cl.next(panel);
					label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					play=1;
					label_4.setText("You Are DIE!");
					b=false;
				}
				if(men>50&old_men>50){
					if(gao[0]!=0){
						gao[0]--;
					Thread cashh=new cash();
					cashh.start();
					chuck[(old_men-50)].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/3char.png")));
					chuck[(men)].setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					old_men=men-50;
					men=old_men;
					chuk++;
					if(chuk>=250){
						label_17.setText("成就：石人！");
					}
					if(chuk>=500){
						label_17.setText("成就：石头怪物！");
					}
					if(chuk>=1000){
						label_17.setText("成就：石头大王！");
					}
					if(iron_s>=300){
						label_17.setText("成就：钢铁侠！");
					}
					if(chuk>=1500){
						label_17.setText("成就：石头BOSS！");
					}

					
				}
			}if(men<50){
				chuck[men].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/3char.png")));	
			}
			}while(false);
				}
		});

		button_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {		
				old_men=men;
				men=old_men;
				if(hp==0){
					CardLayout cl=(CardLayout) panel.getLayout();
					cl.next(panel);
					label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					play=1;
					label_4.setText("You Are DIE!");
					b=false;
				}
				int kuang=0;
				while(kuang<50){
					if(men+50==mu[kuang]){
						mu_s++;
						break;
					}
		            kuang++;
				}
				 kuang=0;
					while(kuang<400){
						if(men+50==mei[kuang]){
							mei_s++;
							break;
						}
			            kuang++;
					}
					 kuang=0;
					while(kuang<100){
						if(men+50==gold[kuang]){
							gold_s++;
							break;
						}
			            kuang++;
					}
					kuang=0;
					while(kuang<50){
						if(men+50==shuijin[kuang]){
							shuijing_s++;
							break;
						}
			            kuang++;
					}
				do{
				if( men+50==die){
					Thread hp_1=new hp();
					hp_1.start();
					hp=hp-10;
					label_1.setText(""+hp);
					break;
				}
				if(gao[0]!=0){
					gao[0]--;
					kuang=0;
					while(kuang<350){
						if(men+50==iron[kuang]){
							iron_s++;
							break;
						}
			            kuang++;
					}
					if(chuk>=250){
						label_17.setText("成就：石人！");
					}
					if(chuk>=500){
						label_17.setText("成就：石头怪物！");
					}
					if(chuk>=1000){
						label_17.setText("成就：石头大王！");
					}
					if(chuk>=1500){
						label_17.setText("成就：石头BOSS！");
					}
					if(iron_s>=300){
						label_17.setText("成就：钢铁侠！");
					}
					Thread cashh=new cash();
					cashh.start();
					chuk++;
					chuck[(old_men+50)].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/char.png")));
					chuck[(old_men)].setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					old_men=men+50;
					men=old_men;
				}
				}while(false);}
				
		});
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				chuck[men].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/1char.png")));	
				old_men=men;
				men=old_men;
				if(hp==0){
					CardLayout cl=(CardLayout) panel.getLayout();
					cl.next(panel);
					label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					play=1;
					label_4.setText("You Are DIE!");
					b=false;
				}
				int kuang=0;
				while(kuang<350){
					if(men-1==iron[kuang]){
						iron_s++;
						break;
					}
		            kuang++;
				}
				 kuang=0;
					while(kuang<400){
						if(men-1==mei[kuang]){
							mei_s++;
							break;
						}
			            kuang++;
					}
				kuang=0;
				while(kuang<50){
					if(men-1==mu[kuang]){
						mu_s++;
						break;
					}
		            kuang++;
				}
				 kuang=0;
				while(kuang<100){
					if(men-1==gold[kuang]){
						gold_s++;
						break;
					}
		            kuang++;
				}
				kuang=0;
				while(kuang<50){
					if(men-1==shuijin[kuang]){
						shuijing_s++;
						break;
					}
		            kuang++;
				}
				do{
				if( men-1==die){
					hp=hp-10;
					Thread hp_1=new hp();
					hp_1.start();
					label_1.setText(""+hp);
					break;
				}
				if(hp==0){
					CardLayout cl=(CardLayout) panel.getLayout();
					cl.next(panel);
					label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					play=1;
					label_4.setText("You Are DIE!");
					b=false;
				}
				if(gao[0]!=0){
					gao[0]--;
					if(chuk>=250){
						label_17.setText("成就：石人！");
					}
					if(chuk>=500){
						label_17.setText("成就：石头怪物！");
					}
					if(chuk>=1000){
						label_17.setText("成就：石头大王！");
					}
					if(chuk>=1500){
						label_17.setText("成就：石头BOSS！");
					}
					if(iron_s>=300){
						label_17.setText("成就：钢铁侠！");
					}
					Thread cashh=new cash();
					cashh.start();
					chuck[(old_men-1)].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/1char.png")));
					chuck[(old_men)].setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					old_men=men-1;
					men=old_men;
					chuk++;
					}
				}while(false);
			}
		});
		button_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				chuck[men].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/2char.png")));
				old_men=men;
				men=old_men;
				int kuang=0;
				while(kuang<350){
					if(men+1==iron[kuang]){
						iron_s++;
						break;
					}
		            kuang++;
				}
				 kuang=0;
					while(kuang<400){
						if(men+1==mei[kuang]){
							mei_s++;
							break;
						}
			            kuang++;
					}
					 kuang=0;
					while(kuang<100){
						if(men+1==gold[kuang]){
							gold_s++;
							break;
						}
			            kuang++;
					}
				kuang=0;
				while(kuang<50){
					if(men+1==mu[kuang]){
						mu_s++;
						break;
					}
		            kuang++;
				}
				kuang=0;
				while(kuang<50){
					if(men+1==shuijin[kuang]){
						shuijing_s++;
						break;
					}
		            kuang++;
				}
				if(hp==0){
					CardLayout cl=(CardLayout) panel.getLayout();
					cl.next(panel);
					label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					play=1;
					label_4.setText("You Are DIE!");
					b=false;
				}
				do{
				if( men+1==die){
					Thread hp_1=new hp();
					hp_1.start();
					hp=hp-10;
					label_1.setText(""+hp);
					break;
				}
				if(hp==0){
					CardLayout cl=(CardLayout) panel.getLayout();
					cl.next(panel);
					label.setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					play=1;
					label_4.setText("You Are DIE!");
					b=false;
				}
				if(chuk>=250){
					label_17.setText("成就：石人！");
				}
				if(iron_s>=300){
					label_17.setText("成就：钢铁侠！");
				}
				if(chuk>=500){
					label_17.setText("成就：石头怪物！");
				}
				if(chuk>=1000){
					label_17.setText("成就：石头大王！");
				}
				if(chuk>=1500){
					label_17.setText("成就：石头BOSS！");
				}
				if(gao[0]!=0){
					gao[0]--;
					Thread cashh=new cash();
					cashh.start();
					chuck[(old_men+1)].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/2char.png")));
					chuck[(old_men)].setIcon(new ImageIcon(MAIN_START.class.getResource("")));
					old_men=men+1;
					men=old_men;
					chuk++;
				}
				}while(false);
			}
		});
	//	}
	}
	
	class zombie_gif extends Thread{
		public void run(){
			while(true){
				chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/zombie.png")));
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				
					}
				chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/creeper.png")));
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				
					}
				}	
			}
		}
	class wifi_gif extends Thread{
		public void run(){
			while(true){
				label_2.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/wifi-1.png")));
				try {
					Thread.sleep(1500);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				
					}
				label_2.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/wifi-2.png")));
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				
					}
				}
			}
		}
	class yanjiang_gif extends Thread{
		public void run(){
			while(true){
			chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/yanjiang.png")));
			try {
				Thread.sleep(200);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/yanjiang-2.png")));
			try {
				Thread.sleep(250);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/yanjiang-3.png")));
			try {
				Thread.sleep(240);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/yanjiang-4.png")));
			try {
				Thread.sleep(220);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/yanjiang-5.png")));
			try {
				Thread.sleep(220);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			chuck[die].setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/yanjiang-6.png")));
			try {
				Thread.sleep(220);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			}
		}
	}
	class cash extends Thread{
		public void run(){
			label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/cash2.png")));
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			
				}
			label_5.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/cash1.png")));
		}
	}
	class hp extends Thread{
		public void run(){
			label_1.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/hp2.png")));
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		label_1.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/hp.png")));
		}
	}
	class fire extends Thread{
		public void run(){
			while(true){
			label_8.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/fire.png")));
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			label_8.setIcon(new ImageIcon(MAIN_START.class.getResource("/RES/fire2.png")));
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	}
	/**
	 * 
	 * @author lka
	 * @return 
	 * @vision 1.0
	 * @since 1.0
	 */
	public static void main(String[] arg){

		MAIN_START Frame=new MAIN_START();
		Frame.setSize(800, 600);
		Frame.setVisible(true);
	}
	class mc extends Thread{
		public void run(){
			label_9.setBounds(0, 50, 160, 67);
			label_10.setBounds(680, 50, 120, 67);
			int tis=0;
			while(tis<=200){

			label_9.setBounds(tis, 50, 160, 67);
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			tis=tis+10;
			}
			int t2s=680;
			while(t2s>=360){

			label_10.setBounds(t2s, 50, 160, 67);
			try {
				Thread.sleep(45);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			t2s=t2s-10;
			}
			lblNewLabel.setBounds(271, 95, 150, 86);
			panel_1.add(lblNewLabel);

		}
	}
	@Override
	public void actionPerformed(ActionEvent arg0) {
	}
}

